<template>
  <!-- 底部部分 => list有数据的时候，才展示  list.length > 0 -->
  <footer  class="footer"  v-if="list.length>0">
    <span class="todo-count"><strong>{{sy}}</strong>剩余</span>
    <ul class="filters">
      <li>
        <a  :class="{selected:chushi==='all'}" @click="$emit('xiuxiu','all')" href="#/">全部</a>
      </li>
      <li>
        <a  :class="{selected:chushi==='wwc'}" @click="$emit('xiuxiu','wwc')" href="#/active">进行中</a>
      </li>
      <li>
        <a  :class="{selected:chushi==='wc'}" @click="$emit('xiuxiu','wc')" href="#/completed">已完成</a>
      </li>
    </ul>
    <!-- 有已完成的任务，才需要显示这个按钮 -->
    <button  class="clear-completed" @click="$emit('qc')">清除已完成</button>
  </footer>
</template>

<script>
export default {
  computed:{
    sy(){
      return this.list.filter(item=>item.done===false).length
    }
  },
  data(){
    return{

    }
  },
    props:{
      list:{
          type:Array,
          required:true,
      },
      chushi:{
        typeof:String,
        required:true,
      }
    }
}
</script>

<style></style>
